<template>
  <div class="">
    <button @click="increment">
      count is: {{ count }}
    </button>
  </div>
</template>

<!--
<script>
import {ref} from 'vue';

export default {
  setup() {
    const count = ref(0);

    function increment() {
      count.value++;
    }

    return {count, increment};
  }
}
</script>
-->

<!--使用语法糖-->
<script setup>
import {ref} from "vue";

const count = ref(0);

function increment() {
  count.value++;
}
</script>